﻿eventModule.controller("detailvacancyController", function ($scope, $routeParams, $location, EventService) {
    EventService.getVacancy($routeParams.id).then(function (vacancy) {
        $scope.vacancy = vacancy;
        $scope.model = {
            message: $routeParams.id
        };
    }, function ()
    { alert('Error Occured.') });


    $scope.update = function (vacancy) {
        EventService.updateVacancy(vacancy).then(function () { $location.url('/Vacancy/List'); }, function ()
        { alert('Cant update Expired vacancy.') });
    };

});